<?php
$params = array_merge(
    require(__DIR__ . '/../../common/config/params.php'),
    require(__DIR__ . '/../../common/config/params-local.php'),
    require(__DIR__ . '/params.php'),
    require(__DIR__ . '/params-local.php')
);

return [
    'id' => 'sms-api',
    'basePath' => dirname(__DIR__),
    'bootstrap' => ['log'],
    'controllerNamespace' => 'api\controllers',
    'defaultRoute' => 'user',
    'timeZone' => 'Asia/Shanghai',
    'components' => [
        'log' => [                         //默认在对应的模块runtime/logs/目录下  ,这里就在api/runtime/logs/app.log下
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],     //这个表示在error 和 warning下会记录日志
                ],
            ],
        ],
        'errorHandler' => [
            'errorAction' => 'error/error',
        ],
        'urlManager' => [
            'enablePrettyUrl' => true,
            'showScriptName' => false,
            'rules' => [
                '<controller:\w+>/<action:\w+>' => '<controller>/<action>',
                '<controller:\w+>/<id:\d+>' => '<controller>/view',
                '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
                '<modules:\w+>/<controller:\w+>/<action:\w+>' => '<modules>/<controller>/<action>',
            ],
        ],

        'oss' => [
            'class' => 'extensions\oss\Aliyun',
            'accessKeyId' => '123456',
            'accessKeySecret' => 'jojfowewoje',
            'endPoint'  => 'jojweoj.jjwo.few',
            'bucket'    => 'banner'
        ],
        'rabbitMq' => [
            'class' => 'common\service\RabbitMq',
            'username' => 'zcy',
            'passwd' => '196000',
            'host' => '192.168.100.108',
            'port' => '5672',
            'vhost' => '/',
        ],
        'request'      => [
            'enableCsrfValidation' => false,
        ],
    ],
    'params' => $params,
];
